<template>
  <div class="info-section" :class="{ 'gap-col-32': isMobile, ' gap-row-16 gap-col-16': !isMobile }">
    <div class="box font-weight-500">
      <div class="font-size-20 mb-2 line-height-140">{{ $t('premium.info.title1') }}</div>
      <div class="font-size-14 mb-6 line-height-140">
        {{ $t('premium.info.subtitle1') }}
      </div>
      <div class="premium">
        <img src="/images/premium/sale.png" alt="Premium-sale" class="premium-sale" />
      </div>
    </div>
    <div class="box font-weight-500">
      <div class="font-size-20 mb-2 line-height-140">{{ $t('premium.info.title4') }}</div>
      <div class="font-size-14 mb-6 line-height-140">
        {{ $t('premium.info.subtitle4') }}
      </div>
      <div class="premium">
        <img src="/images/premium/avatar.png" alt="Premium-avatar" class="premium-avatar" />
      </div>
    </div>
    <div class="box font-weight-500">
      <div class="font-size-20 mb-2 line-height-140">{{ $t('premium.info.title3') }}</div>
      <div class="font-size-14 mb-6 line-height-140">
        {{ $t('premium.info.subtitle3') }}
      </div>
      <div class="premium">
        <img src="/images/premium/common.png" alt="Premium-common" class="premium-common" />
      </div>
    </div>
    <div class="box font-weight-500">
      <div class="font-size-20 mb-2 line-height-140">{{ $t('premium.info.title2') }}</div>
      <div class="font-size-14 mb-6 line-height-140">{{ $t('premium.info.subtitle2') }}</div>
      <div class="premium">
        <img src="/images/premium/translate.png" alt="Premium-translate" class="premium-translate" />
      </div>
    </div>
    <div class="box font-weight-500">
      <div class="font-size-20 mb-2 line-height-140">{{ $t('premium.info.title5') }}</div>
      <div class="font-size-14 mb-6 line-height-140">{{ $t('premium.info.subtitle5') }}</div>
      <div class="premium">
        <img src="/images/premium/custom-avatar.png" alt="Premium-translate" class="premium-translate" />
      </div>
    </div>
  </div>
  <div class="table-section font-size-15 font-weight-500 mb-6">
    <div class="grid-table head-border">
      <div></div>
      <div>{{ $t('premium.table.free') }}</div>
      <div>{{ $t('common.premium') }}</div>
    </div>
    <div class="grid-table">
      <div class="text-start">{{ $t('premium.table.title1') }}</div>
      <div><Icon name="check"></Icon></div>
      <div><Icon name="check"></Icon></div>
    </div>
    <div class="grid-table">
      <div class="text-start">{{ $t('premium.table.title2') }}</div>
      <div><Icon name="check"></Icon></div>
      <div><Icon name="check"></Icon></div>
    </div>
    <div class="grid-table">
      <div class="text-start">{{ $t('premium.table.title3') }}</div>
      <div><Icon name="close"></Icon></div>
      <div><Icon name="check"></Icon></div>
    </div>
    <div class="grid-table">
      <div class="text-start">{{ $t('premium.table.title4') }}</div>
      <div><Icon name="close"></Icon></div>
      <div><Icon name="check"></Icon></div>
    </div>
    <div class="grid-table">
      <div class="text-start">{{ $t('premium.table.title5') }}</div>
      <div><Icon name="close"></Icon></div>
      <div><Icon name="check"></Icon></div>
    </div>
    <div class="grid-table">
      <div class="text-start">{{ $t('premium.table.title6') }}</div>
      <div><Icon name="close"></Icon></div>
      <div><Icon name="check"></Icon></div>
    </div>
    <div class="grid-table">
      <div class="text-start">{{ $t('premium.table.title7') }}</div>
      <div><Icon name="close"></Icon></div>
      <div><Icon name="check"></Icon></div>
    </div>
    <div class="grid-table">
      <div class="text-start">{{ $t('premium.table.title8') }}</div>
      <div><Icon name="close"></Icon></div>
      <div><Icon name="check"></Icon></div>
    </div>
  </div>
</template>

<script setup>
import { storeToRefs } from 'pinia'
import { useAppStore } from '@/store/app'

const appStore = useAppStore()
const { isMobile } = storeToRefs(appStore)
</script>
<style lang="scss" scoped>
.wrapper {
  .content {
    .premium {
      display: flex;
      justify-content: center;
      align-items: center;

      img {
        object-fit: cover;
        max-width: 100%;
        height: auto;
      }

      &-sale {
        width: 16.625rem;
      }
      &-translate {
        width: 19.875rem;
      }
      &-common {
        width: 14.8125rem;
      }
      &-avatar {
        width: 18rem;
      }
    }

    .grid-table {
      display: grid;
      grid-auto-flow: row;
      grid-template-columns: 4fr 1fr 1fr;
      padding-top: 0.75rem;
      &.head-border {
        border-bottom: 0.0625rem solid white;
        padding-bottom: 0.5rem;
      }
    }
  }
}

.desktop {
  .wrapper {
    .content {
      .info-section {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 2rem;
        .box {
          flex: 0 0 auto;
          width: 48%;
          background: #181925;
          border-radius: 1.5625rem;
          padding: 1.5rem 1rem;
          &:last-child {
            margin-bottom: 1rem;
            margin-right: 1rem;
          }

          // 這邊是為了讓最後一個 box 佔滿整個寬度
          &:nth-last-child(1) {
            width: 98%;
          }
        }
      }
      .table-section {
        padding: 1.5rem 9.375rem;
        margin-bottom: 2rem;
      }
    }
  }
}
</style>
